<?
	include '../model/database.php';
	include '../model/xl_nguoi_dung.php';
	include '../model/xl_dia_diem.php';
	include '../model/xl_hinh_anh_dia_diem.php';
	
	$xl_nguoi_dung = new xl_nguoi_dung();
	$xl_dia_diem = new xl_dia_diem();
	$xl_hinh_anh = new xl_hinh_anh_dia_diem();
	
	$maDiaDiem = $_REQUEST['id'];
	$arr1 = $xl_dia_diem->diaDiem($maDiaDiem);
	$diadiem = $arr1[0];
	$manguoidung = $diadiem['MaNguoiDung'];
	$arr2 = $xl_nguoi_dung->layNguoiDung($manguoidung);
	$nguoidung = $arr2[0];
	$arr3 = $xl_hinh_anh->hinhAnhDiaDiem($maDiaDiem);
	$hinhanh = $arr3[0];
	
?>
<table class="NoiDungInfoWin" height="200px;">

	<tbody>
    	<tr>
        <td colspan="2" >
            <div id="loi">
            </div>
		</td>
        </tr>
    	<tr>
        	<td colspan="2" ><span class="loaibds"><?=$diadiem['TenDiaDiem']?></span></td>
        </tr>
        <tr>
        	<td valign="top">
            	<div class="nd_hinhbd_marker">
                	<img width="138px" title="Hình ảnh từ tin bài." alt="Hình ảnh."  src="uploads/place/<? if($hinhanh['DuongDan']!=""){ echo $hinhanh['DuongDan'];}else{ ?>photo_not_available.png<? } ?>">
                </div>
            </td>
            <td width="63%" valign="top">
            	<ul class="thongtin_marker">
                	<li>
                    	<div class="float-left"> Địa chỉ:</div>
                        <div class="float-right textTitle"> <?=$diadiem['DiaChi']?> </div>
                    </li>
                    <li>
                    	<div class="float-left"> Số lượt xem:</div>
						<div class="float-right "><?=$diadiem['SoLuotXem']?></div>
                    </li>
                    <li>
                    	<div class="float-left"> Ngày đăng:</div>
						<div class="float-right "><?=date('d/m/Y',strtotime($diadiem['ThoiGianTao']))?></div>
                    </li>
                    <li>
                    	<div class="float-left"> Người tạo:</div>
						<div class="float-right "><?=$nguoidung['TenHienThi']?></div>
                    </li>
                </ul>
            </td>
        </tr>
    </tbody>
</table>
<table class="NoiDungInfoWinBottom" style="float: left">
	<tbody>
    	<tr>
        	<td style="text-align: left">
            	<span>
                	<a onclick="DirectionTo(<?=$diadiem['ViDo']?>, <?=$diadiem['KinhDo']?>)" href="javascript:void(0);">Tìm đường tới đây</a>
                </span>
            </td>
            <td style="text-align: right">
            	<a target="_blank" href="./?action=dia-diem&idPlace=<?=$diadiem['MaDiaDiem']?>"> Xem chi tiết</a>
            </td>
        </tr>
    </tbody>
</table>